<template>
  <div>
    <Col span="20">
      <Row>
        <div class="layout">
          <Layout>
            <Content>
              <Row>
                <h1 class="title" font-size="20px">{{title}}</h1>
              </Row>
            </Content>
            <Footer>{{ content }}</Footer>
          </Layout>
        </div>
      </Row>
    <Row>
      <h1 font-size='20px'>
        评论区
      </h1>
    </Row>
    </Col>

    <About></About>
  </div>
</template>

<script>
import About from "./About";
export default {
  data() {
    return {
      title:"标题",
      content: "博客内容",
      createTime:"创建时间",
    };
  },
  methods: {
    //获取文章信息
    async getArticle(id) {
      console.log("获取的文章ID为id = ",id);
      let res = await this.send.get('/blog/getArticle/id',{id});
      if(res.data.code == 200) {
        this.title = res.data.data.name;
        this.content = res.data.data.content;
        this.createTime = res.data.data.createTime;
      }
      console.log("文章的内容为 ",res);
    },
  },
  async created() {
    let that = this;
    console.log("that = ",that);
    //获取window.open跳转过来并传递过来的参数
    await that.getArticle(this.$route.query.id);
  },
  components: {
    About,
  },
};
</script>

<style>
</style>